package com.token.iot.bratterycharging.gateway.business;

import com.outstanding.framework.base.SpringContextHolder;
import com.outstanding.framework.core.PendingException;
import com.token.iot.bratterycharging.gateway.InvalidOper;
import com.token.iot.bratterycharging.gateway.ResCode;
import com.token.iot.bratterycharging.gateway.Sender;
import com.token.iot.bratterycharging.gateway.dao.InvalidOperDAO;

public class DuplexProcessorFactory {

	static public DuplexProcessor createDuplexProcessor(String code) throws PendingException {
		DuplexProcessor sender = null;
		try {
			sender = (DuplexProcessor) SpringContextHolder.getBean(code + "DuplexProcessor");
		} catch (Exception e) {
			throw new PendingException(ResCode.DupleNOTFIND);
		}
		sender.setCode(code);
		return sender;

	}
}
